package frankenstein.algo;
import java.util.*;

import frankenstein.datastructures.ParentModel;

public class Pattern  extends ParentModel{

	public static final int STRATEGY = 1;
	public static final int FACADE = 2;
	public static final int MEDIATOR = 3;
	public static final int SOA = 4;
	public static final int PROXY = 5;
	public static final int TEMPLATE = 6;
	public static final int OBSERVER = 7;
	
	
	protected int patternType;
	protected int patternInterface = 0;
	protected String patternName;
	protected int patternClass = 0;
	
	protected LinkedList<Integer> usingResponsibilities;
	protected LinkedList<Integer> usedResponsibilities;
	protected LinkedList<Integer> usingClasses;
	protected LinkedList<Integer> usedClasses;
	
	protected ArrayList<Integer> interfacesInvolved;
	protected ArrayList<Integer> classesInvolved;
	
	public Pattern(){
		
		usingResponsibilities = new LinkedList<Integer>();
		usedResponsibilities = new LinkedList<Integer>();
		usingClasses = new LinkedList<Integer>();
		usedClasses = new LinkedList<Integer>();
		
		interfacesInvolved = new ArrayList<Integer>();
		classesInvolved = new ArrayList<Integer>();
		patternType = 0;
		
	}

	public LinkedList<Integer> getUsingResponsibilities() {
		return usingResponsibilities;
	}

	public void setUsingResponsibilities(LinkedList<Integer> usingResponsibilities) {
		this.usingResponsibilities = usingResponsibilities;
	}

	public LinkedList<Integer> getUsedResponsibilities() {
		return usedResponsibilities;
	}

	public void setUsedResponsibilities(LinkedList<Integer> usedResponsibilities) {
		//System.out.println("vanhat " + this.usedResponsibilities);
		this.usedResponsibilities = usedResponsibilities;
		//System.out.println("uudet " + this.usedResponsibilities + " " + this.toString());
		
	}

	public LinkedList<Integer> getUsingClasses() {
		return usingClasses;
	}

	public void setUsingClasses(LinkedList<Integer> usingClasses) {
		this.usingClasses = usingClasses;
	}

	public LinkedList<Integer> getUsedClasses() {
		return usedClasses;
	}

	public void setUsedClasses(LinkedList<Integer> usedClasses) {
		this.usedClasses = usedClasses;
	}

	public ArrayList<Integer> getInterfacesInvolved() {
		return interfacesInvolved;
	}

	public void setInterfacesInvolved(ArrayList<Integer> interfacesInvolved) {
		this.interfacesInvolved = interfacesInvolved;
	}

	public int getPatternType() {
		return patternType;
	}

	public void setPatternType(int patternType) {
		this.patternType = patternType;
	}

	public int getPatternInterface() {
		return patternInterface;
	}

	public void setPatternInterface(int patternInterface) {
		this.patternInterface = patternInterface;
	}

	public String getPatternName() {
		return patternName;
	}

	public void setPatternName(String patternName) {
		this.patternName = patternName;
	}
	public ArrayList<Integer> getClassesInvolved() {
		return classesInvolved;
	}

	public void setClassesInvolved(ArrayList<Integer> classesInvolved) {
		this.classesInvolved = classesInvolved;
	}
	public int getPatternClass() {
		return patternClass;
	}

	public void setPatternClass(int patternClass) {
		this.patternClass = patternClass;
	}
	/*public boolean equals(Pattern p){
		
		boolean usedResps = false;
		boolean usingResps = false;
		boolean usedClasses = false;
		boolean usingClasses = false;
		boolean patternClass = false;
		boolean patternInterface = false;
		boolean patternType = false;
		
		if(this.usedResponsibilities.equals(p.getUsedResponsibilities()))
			usedResps = true;
		if(this.usingResponsibilities.equals(p.getUsingResponsibilities()))
			usingResps = true;
		if(this.usedClasses.equals(p.getUsedClasses()))
			usedClasses = true;
		if(this.usingClasses.equals(p.getUsedClasses()))
			usingClasses = true;
		if(this.classesInvolved.equals(p.getClassesInvolved()))
			patternClass = true;
		if(this.interfacesInvolved.equals(p.getInterfacesInvolved()))
			patternInterface = true;
		if(this.patternType == p.getPatternType())
			patternType = true;
		
		if(usedResps && usingResps && usedClasses && usingClasses 
				&& patternClass && patternInterface && patternType){
			return true;
		}
		else{
			//System.out.println(usedResps + " " + usingResps + " " + usedClasses + " " + usingClasses + " " + patternClass + " " + patternInterface + " " + patternType);
			return false;
		}
		
	}
	*/
}
